package com.cn.gz.liwy.datatype;

import com.cn.gz.liwy.constan.StaticFinal;

public class MyFloat extends DataTypeBase implements DataType{

    private float float32;

    private Float aFloat;

    public MyFloat(){
        setTypeName("float");
        setTypeSize(size());
        setTypeValueRange(valueRange());
        // byte转换为字符串  方法1
        setTypeDefaultVal(defaultValue());
        setTypePacketClass(packetClass());
        new MyFloat(this);
        out("============"+getTypeName()+"类型使用规则"+"============");
        commonlyUsed();
        illegalUsed();
        out("==================华丽丽的分割线==================");
    }

    public MyFloat (MyFloat MyFloat){
//        将初始好的子类以参数的形式传到父类有参构造
        super(MyFloat);
    }


    @Override
    public int size() {
        return Float.SIZE;
    }

    @Override
    public String valueRange() {
        return Float.MIN_VALUE + "~" +Float.MAX_VALUE;
    }

    @Override
    public String defaultValue() {
        return ""+Float.toString(float32);
    }

    @Override
    public void commonlyUsed() {

    }

    @Override
    public void illegalUsed() {

    }

    @Override
    public String packetClass() {
        return "" + Float.class;
    }
}
